<!-- include tpl=header title=微信扫码支付 -->
<input type="hidden" name="logid" id="logid" value="{$order.id}" />
<input type="hidden" name="sn" id="sn" value="{$rs.sn}" />
<div class="container">
	<div class="m-4">
		<h3 class="p-4 text-center">订单信息</h3>
		<div class="row">
			<div class="col text-end">订单编号</div>
			<div class="col">{$order.sn}</div>
		</div>
		<!-- if $orderinfo -->
		<div class="row">
			<div class="col text-end">订单金额</div>
			<div class="col text-primary">{func price_format $orderinfo.price $orderinfo.currency_id}</div>
		</div>
		<!-- /if -->
		<!-- if $paid_price -->
		<div class="row">
			<div class="col text-end">已付金额</div>
			<div class="col">{func price_format $paid_price $order.currency_id}</div>
		</div>
		<!-- /if -->
		<!-- if $unpaid_price -->
		<div class="row">
			<div class="col text-end">还需付款</div>
			<div class="col am-text-danger">{func price_format $unpaid_price $order.currency_id}</div>
		</div>
		<!-- /if -->
		<div class="m-4 text-center"><img src="api.php?f=qrcode&data={func rawurlencode $info.code_url}" border="0" width="300px" /></div>
	</div>
</div>
<script type="text/javascript">
function pending()
{
	var sn = $("#sn").val()+'-'+$("#logid").val();
	var url = api_url('payment','query','sn='+sn);
	$.phpok.json(url,function(data){
		if(!data.status){
			window.setTimeout(function(){
				pending();
			}, 3000);
			return true;
		}
		url = get_url('payment','show','id='+$("#logid").val());
		$.phpok.go(url);
		return true;
	});
}
$(document).ready(function(){
	window.setTimeout(function(){
		pending();
	}, 5000);
});

//禁止后退
history.pushState(null, null, document.URL);
window.addEventListener('popstate', function () {
    history.pushState(null, null, document.URL);
});
</script>
<!-- include tpl=footer -->